////package com.lwbldy.common.tools;
////
////import com.alibaba.fastjson.JSONArray;
////import com.alibaba.fastjson.JSONObject;
////import com.alibaba.fastjson.serializer.SerializerFeature;
////import com.lwbldy.util.BaseConfig;
////import org.apache.http.HttpEntity;
////import org.apache.http.HttpResponse;
////import org.apache.http.client.methods.HttpPost;
////import org.apache.http.entity.StringEntity;
////import org.apache.http.impl.client.CloseableHttpClient;
////import org.apache.http.impl.client.HttpClients;
////import org.apache.http.util.EntityUtils;
////
////public class RunMain {
////
////    public static void main(String[] args)throws Exception{
//////        String url = BaseConfig.BASE_URL + "edupay/api/pay/putstudents";
//////        String restStr = sendMethod(url);
//////        System.out.println(restStr);
////
////        String url = BaseConfig.BASE_URL + "edupay/api/pay/putbill";
////        String restStr = sendSFZD(url);
////        System.out.println(restStr);
////    }
////
////
////    // url为博思提供的公共接口地址
////    public static String sendMethod(String url) throws Exception{
////        HttpPost httpPost = new HttpPost(url);
////        CloseableHttpClient client = HttpClients.createDefault();
////        String respContent = null;
////
////        // json封装请求参数
////        JSONArray stuList = new JSONArray();
////        JSONObject stuMsg = new JSONObject();
////        stuMsg.put("stu_name", "萧如瑟");
////        stuMsg.put("stu_idcard", "330222195903107318");
////        stuMsg.put("stu_number", "123456");
////        stuMsg.put("enter_year", "2013");
////        stuMsg.put("year_system", "4");
////        stuMsg.put("birthday", "1999-08-09");
////        stuMsg.put("stu_status", "1");
////        stuMsg.put("stu_address", "安徽省合肥市高新区");
////        stuMsg.put("stu_gender", "1");
////        stuMsg.put("bank_name", "中国银行");
////        stuMsg.put("bank_no", "622233552233669");
////        stuMsg.put("phone_number", "13888996655");
////        stuMsg.put("stu_email", "123456789@qq.com");
////        stuMsg.put("remark", "测试学生");
////        stuList.add(stuMsg);
////
////        JSONObject jsonParam = new JSONObject();
////        jsonParam.put("appid", "ceshi001");
////        jsonParam.put("sch_code", "ceshi001");
////        jsonParam.put("nonce_str", "21df7dc9cd8616b56919f20d9f679233");
////        jsonParam.put("stu_list", stuList);
////        // 将json对象转为ASCII码从小到大排序的字符串
////        String jsonStr = JSONObject.toJSONString(jsonParam, SerializerFeature.MapSortField);
////        // 获得签名
////        String signData = SignUtil.sign(jsonStr, SignUtil.privateKey);
////        // 将签名内容封装进json对象
////        jsonParam.put("sign", signData);
////
////
////        StringEntity entity = new StringEntity(jsonParam.toString(), "utf-8");//解决中文乱码问题
////        entity.setContentEncoding("UTF-8");
////        entity.setContentType("application/json");
////        httpPost.setEntity(entity);
////
////        HttpResponse resp = client.execute(httpPost);
////        if (resp.getStatusLine().getStatusCode() == 200) {
////            HttpEntity he = resp.getEntity();
////            respContent = EntityUtils.toString(he, "UTF-8");
////        }
////        return respContent;
////    }
////
//    public static String  sendSFZD(String url){
//        try{
//            HttpPost httpPost = new HttpPost(url);
//            CloseableHttpClient client = HttpClients.createDefault();
//            String respContent = null;
//
//
//            JSONObject jsonParam = new JSONObject();
//            jsonParam.put("appid", "ceshi001"); //公众账号ID
//            jsonParam.put("sch_code", "ceshi001"); //学校编号
//            jsonParam.put("nonce_str", "21df7dc9cd8616b56919f20d9f679233"); // 随机字符串
//
//            jsonParam.put("bill_no","11122223333bill");
//            jsonParam.put("total_amount",2);
//
//            // 学生信息
//            JSONObject stuMsg = new JSONObject();
//            stuMsg.put("stu_name", "萧如瑟");
//            stuMsg.put("stu_idcard", "330222195903107318");
//            stuMsg.put("stu_number", "123456");
//            stuMsg.put("enter_year", "2013");
//            stuMsg.put("year_system", "4");
//            stuMsg.put("birthday", "1999-08-09");
//            stuMsg.put("stu_status", "1");
//            stuMsg.put("stu_address", "安徽省合肥市高新区");
//            stuMsg.put("stu_gender", "1");
//            stuMsg.put("bank_name", "中国银行");
//            stuMsg.put("bank_no", "622233552233669");
//            stuMsg.put("phone_number", "13888996655");
//            stuMsg.put("stu_email", "123456789@qq.com");
//            stuMsg.put("remark", "测试学生");
//            jsonParam.put("stu_info",stuMsg);
//
//            JSONArray chargeList = new JSONArray();
//            JSONObject chargeItems1 = new JSONObject();
//            chargeItems1.put("item_code","0000001");
//            chargeItems1.put("item_amount",6);
//
//            JSONObject chargeItems2 = new JSONObject();
//            chargeItems2.put("item_code","0000002");
//            chargeItems2.put("item_amount",7);
//
//            chargeList.add(chargeItems1);
//            chargeList.add(chargeItems2);
//            jsonParam.put("charge_items",chargeList);
//
//
//            // 将json对象转为ASCII码从小到大排序的字符串
//            String jsonStr = JSONObject.toJSONString(jsonParam, SerializerFeature.MapSortField);
//            // 获得签名
//            String signData = SignUtil.sign(jsonStr, SignUtil.privateKey);
//            // 将签名内容封装进json对象
//            jsonParam.put("sign", signData); //签名
//
//            StringEntity entity = new StringEntity(jsonParam.toString(), "utf-8");//解决中文乱码问题
//            entity.setContentEncoding("UTF-8");
//            entity.setContentType("application/json");
//            httpPost.setEntity(entity);
//
//            HttpResponse resp = client.execute(httpPost);
//            if (resp.getStatusLine().getStatusCode() == 200) {
//                HttpEntity he = resp.getEntity();
//                respContent = EntityUtils.toString(he, "UTF-8");
//            }
//            return respContent;
//
//
//        }catch (Exception e){
//            e.printStackTrace();
//            return null;
//        }
//    }
////
////}
